﻿Imports System.IO

Public Class ClassListe
    Sub New(ByVal Type As String, ByVal Combobox As Object)
        If Type = "MTZ" Then
            Dim basePath = My.Application.Info.DirectoryPath
            Dim mtzDir = basePath & "\1--------MTZ\"
            Combobox.Items.Clear()
            Dim mtzdirInfo As New IO.DirectoryInfo(mtzDir)
            For Each file As FileInfo In mtzdirInfo.GetFiles("*.mtz", SearchOption.TopDirectoryOnly)
                Combobox.Items.Add(file.Name)
            Next
        End If
        If Type = "Folder" Then
            Dim basePath = My.Application.Info.DirectoryPath
            Dim themesDir = basePath & "\2--------Themes\"
            Combobox.Items.Clear()
            Dim themedirInfo As New IO.DirectoryInfo(themesDir)
            For Each folder As DirectoryInfo In themedirInfo.GetDirectories("*", SearchOption.TopDirectoryOnly)
                Combobox.Items.Add(folder.Name)
            Next
        End If
    End Sub
End Class
